
package com.dingwen.sprboojwtstu.result;

import com.alibaba.fastjson.JSON;
import lombok.Data;

import java.io.Serializable;
import java.sql.Timestamp;


/**
 * 结果
 *
 * @author dingwen
 * @date 2021/05/28
 */
@Data
public class Result implements Serializable {

    private static final long serialVersionUID = -5399051578054163779L;
    private int code;
    private String message;
    private Object data;
    private String path;
    private Timestamp currentTime = new Timestamp(System.currentTimeMillis());


    public Result setCode(ResultCode resultCode) {
        this.code = resultCode.code();
        return this;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public Result setMessage(String message) {
        this.message = message;
        return this;
    }

    public Object getData() {
        return data;
    }

    public Result setData(Object data) {
        this.data = data ;
        return this;
    }

    public Timestamp getCurrentTime() {
        return currentTime;
    }

    public Result setCurrentTime(Timestamp currentTime) {
        this.currentTime = currentTime;
        return this;
    }

    public Result setCode(int code) {
        this.code = code;
        return this;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }



}